#if (FEATURE_MODE == 0)
/**
 @file ctc_usw_npm_cli.c

 @date 2012-12-6

 @version v2.0

 The file apply clis of ipuc module
*/

#include "sal.h"
#include "ctc_debug.h"
#include "ctc_error.h"
#include "ctc_npm_cli.h"
#include "ctc_cli_common.h"
#include "ctc_api.h"
#include "ctcs_api.h"
#include "ctc_npm.h"

#define CTC_CLI_NPM_M_STR "NPM Module"

extern int32
sys_usw_npm_show_status(uint8 lchip);

extern int32
sys_usw_npm_im_show_flow_db(uint8 lchip, uint32 flow_id, uint8 is_all);

CTC_CLI(ctc_cli_usw_npm_show_status,
        ctc_cli_usw_npm_show_status_cmd,
        "show npm status",
        CTC_CLI_SHOW_STR,
        CTC_CLI_NPM_M_STR,
        "NPM status"
        )
{
    int32 ret = 0;

    ret = sys_usw_npm_show_status(g_api_lchip);
    if (ret < 0)
    {
        ctc_cli_out("%% %s \n", ctc_get_error_desc(ret));
        return CLI_ERROR;
    }
    return CLI_SUCCESS;
}

CTC_CLI(ctc_cli_usw_npm_show_im_flow,
        ctc_cli_usw_npm_show_im_flow_cmd,
        "show npm im-flow (flow-id FLOWID | all )",
        CTC_CLI_SHOW_STR,
        CTC_CLI_MPLS_M_STR,
        "In-Band Measurement Flow",
        "Flow Id",
        "FlOWID",
        "All"
        )
{
    int32 ret  = CLI_SUCCESS;
    uint32 flow_id = 0;
    uint8 index = 0;
    uint8 is_all = 0;

    index = CTC_CLI_GET_ARGC_INDEX("flow-id");
    if (0xFF != index)
    {
        CTC_CLI_GET_UINT32("flow-id", flow_id, argv[index + 1]);
    }
    index = CTC_CLI_GET_ARGC_INDEX("all");
    if (0xFF != index)
    {
        is_all = 1;
    }

    ret = sys_usw_npm_im_show_flow_db(g_api_lchip,flow_id, is_all);
    if (ret < 0)
    {
        ctc_cli_out("%% %s \n", ctc_get_error_desc(ret));
        return CLI_ERROR;
    }

    return ret;
}



int32
ctc_usw_npm_cli_init(void)
{
    install_element(CTC_SDK_MODE, &ctc_cli_usw_npm_show_status_cmd);
    install_element(CTC_SDK_MODE, &ctc_cli_usw_npm_show_im_flow_cmd);
    
    return CLI_SUCCESS;
}

int32
ctc_usw_npm_cli_deinit(void)
{
    uninstall_element(CTC_SDK_MODE, &ctc_cli_usw_npm_show_status_cmd);
    uninstall_element(CTC_SDK_MODE, &ctc_cli_usw_npm_show_im_flow_cmd);
    
    return CLI_SUCCESS;
}

#endif

